/**
 * 请求封装
 */

import baseUrl from "./config.js"

/**
 * 请求体
 */

export default (url, data = {}, method = "GET") => {
	return new Promise((resolve, reject) => {
		uni.request({
			url: baseUrl + url,
			method: method,
			data,
			success: (res) => {
				resolve(res.data)
			},
			fail: (err) => {
				reject(err.data)
			}
		})
	})
}